package com.bwie.controller;
import com.bwie.domain.Activity;
import com.bwie.service.ActivityService;
import com.bwie.service.impl.ActivityServiceImpl;
import com.bwie.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_activity)表控制层
*
* @author xxxxx
*/

@RestController
@RequestMapping("/activity/index")
public class ActivityController {
/**
* 服务对象
*/
    @Autowired
    private ActivityService activityService;


    @GetMapping("/getActivityList")
    public R getActivityList(){
        return activityService.getActivityList();
    }

    @PostMapping("/insertActivity")
    public R insertActivity(@RequestBody Activity activity){
        return activityService.insertActivity(activity);
    }

    @PostMapping("/updateActivity")
    public R updateActivity(@RequestBody Activity activity){
        return activityService.updateActivity(activity);
    }

    @PostMapping("/deleteActivity/{id}")
    public R deleteActivity(@PathVariable("id") Integer id){
        return activityService.deleteActivity(id);
    }
}
